<extend name="Layout:layout_content" />
<block name="body_main">  
    <ul class="xsui-breadcrumb">
        <li><a href="{:AddonU('customer_list')}"><i  class="fa fa-home fa-fw"></i>调度客户</a></li>
        <li class="current">条件调度</li>
    </ul>
    <h3 class="htitle">{$meta_title}</h3>
    <form action="{:AddonU('dispatch_edit')}" method="get" class="xsui-form">
        <fieldset style="border-bottom:solid 1px #CCC; margin-bottom:10px; padding-bottom:10px;">
            <legend>客户查询</legend>
            <table class="xsui-form-table">
                <tr>
                    <td colspan="2">最后下单时间：<sohtml:sqlexpselect name="lastBuyTimeExpBegin" skips="IN,NEQ,LIKE" value="{$search.lastBuyTimeExpBegin}" /><input type="text" name="lastBuyTimeBegin" class="datepicker" size="10" value="{$search.lastBuyTimeBegin}" /> 且 <sohtml:sqlexpselect name="lastBuyTimeExpEnd" skips="IN,NEQ,LIKE" value="{$search.lastBuyTimeExpEnd}" /><input type="text" name="lastBuyTimeEnd" class="datepicker" size="10" value="{$search.lastBuyTimeEnd}" /></td>
                </tr>
                <tr>
                    <td colspan="2">最后联系时间：<sohtml:sqlexpselect name="lastVisitTimeExpBegin" skips="IN,NEQ,LIKE" value="{$search.lastVisitTimeExpBegin}" /><input type="text" name="lastVisitTimeBegin" class="datepicker" size="10" value="{$search.lastVisitTimeBegin}" /> 且 <sohtml:sqlexpselect name="lastVisitTimeExpEnd" skips="IN,NEQ,LIKE" value="{$search.lastVisitTimeExpEnd}" /><input type="text" name="lastVisitTimeEnd" class="datepicker" size="10" value="{$search.lastVisitTimeEnd}" /></td></tr>
                <tr>
                    <td>购买次数：<sohtml:sqlexpselect name="buyCountExp" skips="IN,NEQ,LIKE" value="{$search.buyCountExp}" /><input type="text" name="buyCount" size="5" value="{$search.buyCount}" />次</td>
                <td>&nbsp;累计消费：<sohtml:sqlexpselect name="cumulativeAmountExp" skips="IN,NEQ,LIKE" value="{$search.cumulativeAmountExp}" /><input type="text" name="cumulativeAmount" size="8" value="{$search.cumulativeAmount}" />元</td>
                </tr>
                <tr>
                    <td>原来工号：<input type="text" name="oldUsers" size="30" placeholder="多个工号之间以英文逗号隔开" value="{$search.oldUsers}" /></td>
                    <td>&nbsp;订单情况：<sohtml:select name="buyCountState" items="2=全部;0=无订单;1=有订单" value="{$search.buyCountState}" /></td>
                </tr>
                <tr>
                    <td>调度数量：<input type="text" name="searchNumber" placeholder="单次建议不超过1000个" value="{$search.searchNumber}" /></td>
                    <td>&nbsp;</td>
                </tr>
            </table>
            <button type="submit" class="ui-state-default"><i class="fa fa-search"></i>查询</button>
            <button type="reset" class="ui-state-default">重置</button>
        </fieldset>
    </form>
    <form action="{:AddonU('dispatch_edit_save')}" method="post">
        <div style="width:600px;">
            <div style="width:300px; float:left; max-height: 130px; overflow-y: auto;">
                <div style="margin-left:5px;">共<strong style="color:#F00; font-weight:bold; padding:0px 3px;">{$sum.count}</strong>个客户, 其中有订单客户<strong style="color:#F00; font-weight:bold; padding:0px 3px;">{$sum.has_order_count}</strong>个</div>
                <table class="xsui-table xsui-table-bordered" data-checkbox="false">
                    <tr>
                        <th>客户编号</th>
                        <th>客户姓名</th>
                        <th>购买次数</th>
                    </tr>
                    <foreach name="list" item="vo">
                        <tr>
                            <td>{$vo.serial_no}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.buy_count}</td>
                        </tr>
                    </foreach>
                </table>
            </div>
            <div style="width:280px; float:left; margin-left:10px;">
                <form method="post" class="xsui-form xsui-form-vertical">
                    <div class="xsui-form-field">
                        <label>分配工号：</label>
                        <input type="text" name="newUsers" placeholder="多个工号之间以英文逗号隔开,如：301,302" size="45" />
                    </div>
                    <div class="xsui-form-field">
                        <label>人均分配：</label>
                        <input type="text" name="perNumber" placeholder="不填则由系统后台分配,如：10" size="45" />
                    </div>
                    <div class="xsui-form-field">
                        <label>备注信息：</label>
                        <input type="text" name="remark" placeholder="备注信息" size="45" />
                    </div>
                    <button type="submit" class="ui-state-default"><i class="fa fa-save"></i>立即分配</button>
                    <button type="reset" class="ui-state-default">重置</button>
                </form>
            </div>
            <div style="clear:both;"></div>
        </div>
    </form>
</block>
<block name="body_after">
    <script type="text/javascript">
        $('.notbreakline-ellipsis').hover(function () {
            $(this).attr('title', $(this).text());
        })
        var $frmSearch = $('#frmSearch');
        $frmSearch.find(':button').click(function () {
            $frmSearch.find('select option[value=""]').prop('selected', true);
            $frmSearch.find(':text').val('');
        })
    </script>
</block>